<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\admin\model;

class Admin extends \app\BaseModel
{
    protected $name = "longbing_admin";
    public function role()
    {
        return $this->hasOne("Role", "role_id", "role_id");
    }
    public function company()
    {
        return $this->hasOne("Company", "company_id", "company_id");
    }
    public function createAdmin($data)
    {
        return $this->createRow($data);
    }
    public function updateAdmin($filter, $data)
    {
        return $this->updateRow($filter, $data);
    }
    public function delAdmin($filter)
    {
        return $this->delRow($filter);
    }
    public function getAdmin($filter)
    {
        $data = $this->with(["company" => function ($query) {
            $query->where(["deleted" => 0, "status" => 1])->field("company_name ,is_top");
        }])->where($filter)->find();
        if(!empty($data)) {
            $data = $data->toArray();
        }
        return $data;
    }
    public function listAdmin($filter, $page_config)
    {
    }
    public function listAdminCount($filter)
    {
    }
    public function listAdminAll($filter)
    {
    }
}

?>